var utils = require("../../utils/utils");
var ocrGml = require("../../utils/ocrGml");
var ACTION = require("../../base/action");
var common = require("./common");
var actionTreasure = new ACTION("开宝箱", {
  interval: null, //每个多少秒执行一次
  storage: common.storage,
});
var inTask = require("./inTask");
actionTreasure.exec = function () {
  var contents = ["开宝箱得金币", "开宝箱"];
  var ocrItem = ocrGml.captureExistOne(contents, true);
  if (ocrItem) {
    utils.clickOcrItem(ocrItem);
    sleep(utils.getRandom(2.5, 3, 1000));
    inTask.run();
    return;
  }
};

module.exports = actionTreasure;
